﻿using Castle.ActiveRecord;
using Castle.ActiveRecord.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;
using Xiaov.SmartWeb.Infrastructure.Config;


namespace Xiaov.SmartWeb.Application
{
    public class Global : System.Web.HttpApplication
    {

        protected void Application_Start(object sender, EventArgs e)
        {
            //ActiveRecord
            IConfigurationSource source = WebAppConfig.ActiveRecord as IConfigurationSource;
            ActiveRecordStarter.Initialize(System.Reflection.Assembly.Load("Xiaov.SmartWeb.Model"), source);
            //DbHelper--Oracle            
            SSEC.DataBaseDict.DataHelperFactroy.InitializeDBHelper(SSEC.DataBaseDict.DbHelperEnum.DbHelperOra);
            SSEC.DataBaseDict.DataHelperFactroy.Instance().SetConn(WebAppConfig.ConnectionString);
            SSEC.DataBaseDict.DictFactroy.InitializeDict(SSEC.DataBaseDict.DictEnum.OracleDict);
            //CacheFactroy
            Xiaov.SmartWeb.Infrastructure.Cache.CacheFactroy.InitCacheFactroy(new Xiaov.SmartWeb.Infrastructure.Cache.HttpRuntimeCache());
        }

        protected void Session_Start(object sender, EventArgs e)
        {

        }

        protected void Application_BeginRequest(object sender, EventArgs e)
        {

        }

        protected void Application_AuthenticateRequest(object sender, EventArgs e)
        {

        }

        protected void Application_Error(object sender, EventArgs e)
        {

        }

        protected void Session_End(object sender, EventArgs e)
        {

        }

        protected void Application_End(object sender, EventArgs e)
        {

        }
    }
}